package cn.sinata.wanglin.adapter;

import com.facebook.drawee.view.SimpleDraweeView;
import com.xilada.xldutils.adapter.HFRecyclerAdapter;
import com.xilada.xldutils.adapter.util.ViewHolder;
import com.xilada.xldutils.utils.TimeUtils;

import java.util.List;

import cn.sinata.wanglin.R;
import cn.sinata.wanglin.model.ProperNotice;
import cn.sinata.wanglin.utils.ImageUtil;

/**
 * 
 * Created by liaoxiang on 16/12/10.
 */

public class ProperNoticeAdapter extends HFRecyclerAdapter<ProperNotice> {
    public ProperNoticeAdapter(List<ProperNotice> mData) {
        super(mData, R.layout.item_propernotice);
    }

    @Override
    public void onBind(int position, ProperNotice mProperNotice, ViewHolder holder) {
        SimpleDraweeView iv_headview = holder.bind(R.id.iv_headview);
        iv_headview.setImageURI(ImageUtil.parseImageUri(mProperNotice.getImg()));
        holder.setText(R.id.tv_title,mProperNotice.getTitle());
        holder.setText(R.id.tv_comment,mProperNotice.getCommentCount()+"");
        holder.setText(R.id.tv_time, TimeUtils.getTimeYYYYMMDDHHmm(mProperNotice.getCreateDate()));
    }
}
